package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Created by Administrator on 2017/9/11.
 */
public class ConnectionUtils {
    public static Connection getConnection (){
        //加载驱动名称
        //下面三个参数分别指的是路径 用户名 密码
        try {
            Class.forName("com.mysql.jdbc.Driver");
            Connection conn= DriverManager.getConnection("jdbc:mysql://localhost:3307/usea","root","123456");
            return conn;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
